package dialer.ws.base.entity;

import java.sql.Time;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * QueueCallEntry entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "queue_call_entry", catalog = "call_center")
public class QueueCallEntry implements java.io.Serializable {

	// Fields

	private Integer id;
	private String queue;
	private Date dateInit;
	private Time timeInit;
	private Date dateEnd;
	private Time timeEnd;
	private String estatus;
	private String script;
	private Set<CurrentCallEntry> currentCallEntries = new HashSet<CurrentCallEntry>(
			0);
	private Set<CampaignEntry> campaignEntries = new HashSet<CampaignEntry>(0);
	private Set<CallEntry> callEntries = new HashSet<CallEntry>(0);

	// Constructors

	/** default constructor */
	public QueueCallEntry() {
	}

	/** minimal constructor */
	public QueueCallEntry(String estatus) {
		this.estatus = estatus;
	}

	/** full constructor */
	public QueueCallEntry(String queue, Date dateInit, Time timeInit,
			Date dateEnd, Time timeEnd, String estatus, String script,
			Set<CurrentCallEntry> currentCallEntries,
			Set<CampaignEntry> campaignEntries, Set<CallEntry> callEntries) {
		this.queue = queue;
		this.dateInit = dateInit;
		this.timeInit = timeInit;
		this.dateEnd = dateEnd;
		this.timeEnd = timeEnd;
		this.estatus = estatus;
		this.script = script;
		this.currentCallEntries = currentCallEntries;
		this.campaignEntries = campaignEntries;
		this.callEntries = callEntries;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "queue", length = 50)
	public String getQueue() {
		return this.queue;
	}

	public void setQueue(String queue) {
		this.queue = queue;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date_init", length = 10)
	public Date getDateInit() {
		return this.dateInit;
	}

	public void setDateInit(Date dateInit) {
		this.dateInit = dateInit;
	}

	@Column(name = "time_init", length = 8)
	public Time getTimeInit() {
		return this.timeInit;
	}

	public void setTimeInit(Time timeInit) {
		this.timeInit = timeInit;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "date_end", length = 10)
	public Date getDateEnd() {
		return this.dateEnd;
	}

	public void setDateEnd(Date dateEnd) {
		this.dateEnd = dateEnd;
	}

	@Column(name = "time_end", length = 8)
	public Time getTimeEnd() {
		return this.timeEnd;
	}

	public void setTimeEnd(Time timeEnd) {
		this.timeEnd = timeEnd;
	}

	@Column(name = "estatus", nullable = false, length = 1)
	public String getEstatus() {
		return this.estatus;
	}

	public void setEstatus(String estatus) {
		this.estatus = estatus;
	}

	@Column(name = "script", length = 65535)
	public String getScript() {
		return this.script;
	}

	public void setScript(String script) {
		this.script = script;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "queueCallEntry")
	public Set<CurrentCallEntry> getCurrentCallEntries() {
		return this.currentCallEntries;
	}

	public void setCurrentCallEntries(Set<CurrentCallEntry> currentCallEntries) {
		this.currentCallEntries = currentCallEntries;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "queueCallEntry")
	public Set<CampaignEntry> getCampaignEntries() {
		return this.campaignEntries;
	}

	public void setCampaignEntries(Set<CampaignEntry> campaignEntries) {
		this.campaignEntries = campaignEntries;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "queueCallEntry")
	public Set<CallEntry> getCallEntries() {
		return this.callEntries;
	}

	public void setCallEntries(Set<CallEntry> callEntries) {
		this.callEntries = callEntries;
	}

}